package com.example.smartagrisys.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 肥料库存实体类
 */
@Data
@TableName("fertilizer_inventory")
public class FertilizerInventory implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 库存ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 农户ID
     */
    private Long farmerId;

    /**
     * 肥料ID
     */
    private Long fertilizerId;

    /**
     * 库存数量(kg)
     */
    private BigDecimal quantity;

    /**
     * 单价(元/kg)
     */
    private BigDecimal price;

    /**
     * 生产日期
     */
    private LocalDateTime productionDate;

    /**
     * 过期日期
     */
    private LocalDateTime expiryDate;

    /**
     * 备注
     */
    private String note;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 是否删除(0未删除,1已删除)
     */
    @TableLogic
    private Integer deleted;
} 